package com.business.bean.oa;

import java.util.Date;

import lombok.Getter;
import lombok.Setter;
import net.sf.rose.jdbc.bean.ModelBean;
import net.sf.rose.jdbc.bean.annotation.Column;
import net.sf.rose.jdbc.bean.annotation.Table;
import net.sf.rose.jdbc.bean.annotation.Type;
import net.sf.rose.jdbc.bean.annotation.View;

@Setter
@Getter
@Table(name = "OA_REPORT_DAY_DETAIL", description = "工作日报明细表")
@View(name = "OA_REPORT_DAY_DETAIL_VIEW", description = "工作日报明细视图")
public class ReportDayDetail extends ModelBean {

	@Column(pk = true, type = Type.定长文本, description = "明细编号", canNull = false, size = 32, policy = "UUID")
	private String detailID = null;

	@Column(type = Type.定长文本, description = "日报编号", size = 32)
	private String dayReportID = null;

	@Column(type = Type.定长文本, description = "用户编号", size = 32)
	private String userID = null;

	@Column(type = Type.变长文本, description = "工号", size = 10)
	private transient String workNo = null;

	@Column(type = Type.变长文本, description = "用户姓名", size = 50)
	private transient String userName = null;

	@Column(type = Type.定长文本, description = "部门编号", size = 32)
	private transient String departID = null;

	@Column(type = Type.变长文本, description = "部门名称", size = 100)
	private transient String departName = null;

	/** yyyy-mm-dd */
	@Column(type = Type.定长文本, description = "日期", size = 10)
	private String calendarDate = null;

	@Column(type = Type.日期时间, description = "开始工作时间")
	private Date beginWorkTime = null;

	@Column(type = Type.日期时间, description = "结束工作时间")
	private Date endWorkTime = null;

	@Column(type = Type.数字双精度型, description = "工作时长")
	private double workTime = 0;

	@Column(type = Type.数字双精度型, description = "加班时长")
	private double overTime = 0;

	@Column(type = Type.变长文本, description = "系统备注", size = 250)
	private String remark = null;

	@Column(type = Type.定长文本, description = "工程调度编号", size = 32)
	private String dispatchWorkID = null;

	@Column(type = Type.定长文本, description = "项目编号", size = 32)
	private String projectID = null;

	/** 有效：1；结束：2 */
	@Column(type = Type.数字整型, description = "状态")
	private int status = 0;

	@Column(type = Type.定长文本, description = "确认人编号", size = 32)
	private String confirmUserID = null;

	@Column(type = Type.定长文本, description = "校对人编号", size = 32)
	private String checkUserID = null;

	@Column(type = Type.定长文本, description = "审核人编号", size = 32)
	private String examineUserID = null;

	public void addRemark(String remark) {
		if (this.remark == null) {
			this.remark = remark;
		} else {
			this.remark = this.remark + ',' + remark;
		}
	}

}
